package com.service;

import com.dao.ums.MemberDao;
import com.entity.ums.Member;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MemberService {
    @Autowired
    private MemberDao memberDao;

    public Member getMemberById(Integer id) {
        return this.memberDao.getMember(id);
    }

    public Member getMemberAndAddressByMemberId(Integer id) {
        return this.memberDao.getMemberAndReceive(id);
    }

    public int updateMember(String phone, Integer id) {
        if (phone == null || id == null) {
            return 0;
        }
        Member member = new Member();
        member.setPhone(phone);
        member.setId(id);
        int i = memberDao.updateMember(member);
        return i;
    }
}
